package com.longxi.tianjintianbao.ui.activity.common;

import android.content.Intent;
import android.support.v7.widget.RecyclerView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.common.CompleteEnterAtPresenter;
import com.longxi.tianjintianbao.ui.view.common.ICompleteEnterAtView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

/**
 * Created by 70339 on 2018/5/17.
 * 代码无八阿哥
 * 阿弥陀佛
 */
public class CompleteEnterActivity extends BaseActivity<ICompleteEnterAtView, CompleteEnterAtPresenter> implements ICompleteEnterAtView {
    @Override
    protected int provideContentViewId() {
        return R.layout.activity_complete_enter;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.initAdapter();
        mPresenter.setUi();
        mTvRight.setOnClickListener(v -> mPresenter.onClickSaveBtn());
    }

    @Override
    protected CompleteEnterAtPresenter createPresenter() {
        return new CompleteEnterAtPresenter(this);
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mRefreshLayout;
    }

    @Override
    public RecyclerView getRvContent() {
        return mRvContent;
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode != RESULT_OK) {
            return;
        }
        mPresenter.onActivityResult(requestCode, resultCode, data);
    }
}
